import request from "@/utils/request";
// 增加订单
export function addOrder(data){
    return request({
        url:'/orders',
        method:'post',
        data
    })
}
// 增加订单详情
export function addOrderDetail(data){
    return request({
        url:'/order-detail',
        method:'post',
        data
    })
}

// 通过用户名与商店名获得订单信息
export  function getOrder(params){
    return request({
        url:'/orders/get-order',
        params
    })
}

// 获得订单细节
export function getOrderDetail(params){
    return request({
        url:'/order-detail',
        params
    })
}

// 修改订单为已支付
export function updateOrder(params){
    return request({
        url:'/orders/update-order',
        params
    })
}
// 获得用户所有订单
export  function getAllOrders(params){
    return request({
        url:'/orders/get-user-order',
        params
    })
}

// 删除订单详情
export function removeOrderDetail(params){
    return request({
        url:'/order-detail',
        method:'delete',
        params
    })
}

// 删除订单
export function removeOrder(params){
    return request({
        url:'/orders/remove-order',
        method:'delete',
        params
    })
}
// 商家获得所有本店的未删除的订单
export function getShopOrders(params){
    return request({
        url:'/orders/get-order-business',
        params
    })
}

// 商家更改订单状态
export function confirmOrder(data){
    return request({
        url:'/orders/update-status',
        method:'put',
        data
    })
}